package com.league.zjxn.main.mine

import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.SPStaticUtils
import com.league.zjxn.R
import com.league.zjxn.main.access.AccessActivity
import com.league.zjxn.main.home.AgreeDetailsActivity
import com.module.lemlin.owner.OwnerAbstractActivity
import kotlinx.android.synthetic.main.activity_mine_setting.*

class MineSettingActivity : OwnerAbstractActivity() {

    companion object {
        fun open() {
            ActivityUtils.startActivity(MineSettingActivity::class.java)
        }
    }

    override val layoutResId: Int
        get() = R.layout.activity_mine_setting

    override fun stateBar(): StatusBar {
        return StatusBar(view = flMineSettingBar)
    }

    override fun initView() {
        //更换手机号
        tvMineSettingPhone.setOnClickListener {
            SettingAccountActivity.openPhone()
        }
        //设置新密码
        tvMineSettingPwd.setOnClickListener {
            SettingAccountActivity.openPwd()
        }
        //隐私政策
        tvMineSettingPrivacy.setOnClickListener {
            AgreeDetailsActivity.openPrivacy("隐私政策")
        }
        //用户协议
        tvMineSettingUser.setOnClickListener {
            AgreeDetailsActivity.openUser("用户协议")
        }
        //退出登录
        tvMineSettingExit.setOnClickListener {
            SPStaticUtils.clear()
            ActivityUtils.finishAllActivities()
            AccessActivity.open()
        }


        tvMineSettingVersion.text = "V${AppUtils.getAppVersionName()}"
    }
}